package com.maserb.monitor.entity.jwQuestion;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

//测评问题选项表
@Data
@Entity
@Table(name = "jw_question_option")
public class JwQuestionOptionEntity implements java.io.Serializable{

    @GenericGenerator(name = "idGenerator", strategy = "uuid")
    @GeneratedValue(generator = "idGenerator")
    @Id
    private String id;
    //排序
    private int orderIndex;
    //标题
    @Excel(name = "内容",orderNum = "1", width = 40)
    @Column (length = 1000)
    @NotNull
    private String name;
    //类型
    /*@Excel(name = "是否得分",replace = {"是_1","否_2"}, width = 30)*/
    private String type;
    //描述
    @Column (length = 400)
    private String description;
    //得票数
    @Excel(name = "选择次数",orderNum = "2",  width = 40)
    private int count;
    //是否选中
    private int isSelected;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "question_item_id")
    @JsonBackReference
    private JwQuestionItemEntity parent;

}
